﻿/**********************************************************************
 * @file   GUIFESensorDialog.h
 * @brief  FE传感器界面类
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-12-30
 *********************************************************************/
#ifndef _GUIFESensorDialog_H
#define _GUIFESensorDialog_H

#include "GUISubSystemDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"

namespace Ui
{
    class GUIFESensorDialog;
}

namespace Core
{
    class FITKActionOperator;
}

namespace Acoustics
{
    class FITKAcousticsSensors;
}

namespace GUI
{
    /**
     * @brief FE Sensor create or edit widget
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-10-23
     */
    class GUISubSystemDialogAPI GUIFESensorDialog :public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief    create object
         * @param[i] oper  operator
         * @param[i] parent 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-30
         */
        GUIFESensorDialog(Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief edit object
         * @param[i]  obj            My Param doc
         * @param[i]  oper           operator
         * @param[i]  parent
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        GUIFESensorDialog(Acoustics::FITKAcousticsSensors* obj, Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief Destroy object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        virtual ~GUIFESensorDialog();
        /**
         * @brief init
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        virtual void initData();

    protected slots:
        /**
         * @brief cencel button clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        void on_pushButton_Cancel_clicked();
        /**
         * @brief OK button clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        void on_pushButton_OK_clicked();
        /**
         * @brief    radioButton Node toggled slot
         * @param[i] checkState 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_radioButton_Node_toggled(bool checkState);
        /**
         * @brief    radioButton Element toggled slot
         * @param[i] checkState
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_radioButton_Element_toggled(bool checkState);
        /**
         * @brief    radioButton Global toggled slot
         * @param[i] checkState
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_radioButton_Global_toggled(bool checkState);
        /**
         * @brief    radioButton Local toggled slot
         * @param[i] checkState
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_radioButton_Local_toggled(bool checkState);
        /**
         * @brief    lineEdit Gx editingFinished slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_lineEdit_Gx_editingFinished();
        /**
         * @brief    lineEdit Gy editingFinished slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_lineEdit_Gy_editingFinished();
        /**
         * @brief    lineEdit Gz editingFinished slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_lineEdit_Gz_editingFinished();
        /**
         * @brief    lineEdit Lx editingFinished slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_lineEdit_Lx_editingFinished();
        /**
         * @brief    lineEdit Ly editingFinished slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_lineEdit_Ly_editingFinished();
        /**
         * @brief    lineEdit Lz editingFinished slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void on_lineEdit_Lz_editingFinished();

    protected:
        /**
         * @brief    初始化界面隐藏组件
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-09
         */
        void initWidgetHideComponent();
        /**
         * @brief    初始化结果类型下拉框
         * @param[i] 类型 : 节点 单元
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void initResultTypeComboBox(int type);
        /**
         * @brief    初始化图标
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-31
         */
        void initImage();
        /**
         * @brief    创建新的传感器数据
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-09
         */
        void createNewSensorData();
        /**
         * @brief    查重名称-并返回新名称
         * @param[i] name 
         * @return   QString
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-09
         */
        QString ckeckNameFromMgr(QString name);
        /**
         * @brief    更新全局坐标
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void updateGlobalOrientation();
        /**
         * @brief    更新局部坐标
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-10
         */
        void updateLocalOrientation();
        /**
         * @brief    创建数据对象
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-06
         */
        bool createObjData();
        /**
         * @brief    编辑数据对象
         * @return   boiol
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-06
         */
        bool editObjData();
        /**
         * @brief    
         * @return   void
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        virtual void accept() override;
        /**
         * @brief    关闭槽
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        virtual void reject() override;
        /**
         * @brief    从界面里获取设置的名称
         * @return   QString
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-10
         */
        void getDataFormWidget();
        /**
         * @brief    显示事件重写
         * @param[i] event             事件对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void showEvent(QShowEvent *event) override;
        /**
         * @brief    取消高亮
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void disHight();
    protected:
        /**
         * @brief ui object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Ui::GUIFESensorDialog* _ui = nullptr;
        /**
         * @brief 传感器数据对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Acoustics::FITKAcousticsSensors* _obj = nullptr;
        /**
         * @brief 操作器对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Core::FITKActionOperator* _oper = nullptr;
    };
}

#endif
